Skip to content

Add env flag to accept swift-crypto beta releases - #302

Merged
Lukasa merged 2 commits into
apple:mainfrom
josephnoir:crypto-beta-env
Jul 1, 2026
Merged

Add env flag to accept swift-crypto beta releases#302
Lukasa merged 2 commits into
apple:mainfrom
josephnoir:crypto-beta-env

Conversation

@josephnoir

Copy link
Copy Markdown
Contributor

Motivation

Tagged releases can only have other tagged releases in their dependencies. Tagging a package that depends on a swift-crypto beta and swift-certificates requires a swift-certificates release that accepts a swift-crypto beta release.

Modifications

Introduce an environment flag that allows swift-certificates to depend on swift-crypto beta releases.

Results

Setting an environment flag can widen the upper limit of accepted swift-cryto version to include 5.0.0 beta release.

Motivation:

Tagged releases can only have other tagged versions in their
dependencies. Tagging a package that depends on a swift-crypto beta
and swift-certificates requires a swift-certificates release that
accepts a swift-crypto beta release.

Modifications:

Introduce an environement flag that allows swift-certificates to depend
on swift-crypto beta releases.

Results:

Setting an environment flag can widen the upper limit of accepted
swift-cryto version to include 5.0.0 beta release.
Comment thread Package.swift
//
// Note: A beta release can only be used if other packages in the dependency tree
// that have a direct dependency on swift-crypto accept beta releases as well.
if ProcessInfo.processInfo.environment["SWIFT_CERTIFICATES_ALLOW_SWIFT_CRYPTO_BETA"] == nil {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentionally nested?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the intention was for local dependencies to have precedence. Flipping the comparisons could make this an else if branch.

if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] != nil {
  // use local repos
} else if ProcessInfo.processInfo.environment["SWIFT_CERTIFICATES_ALLOW_SWIFT_CRYPTO_BETA"] != nil {
  // accept swift-crypto beta releases
} else {
  // default dependency range
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh gotcha, I see.

@josephnoir josephnoir added the semver/none No version bump required. label Jul 1, 2026
@Lukasa
Lukasa merged commit 89fbc37 into apple:main Jul 1, 2026
41 of 45 checks passed
@josephnoir
josephnoir deleted the crypto-beta-env branch July 1, 2026 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/none No version bump required.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants